REPLICATION PACKAGE FOR
////////////////////////////////////////////////////////////////////////////////
// INTERNATIONAL PORTFOLIO CHOICE WITH FRICTIONS: EVIDENCE FROM MUTUAL FUNDS
// by
// Philippe Bacchetta, Simon Tièche, and Eric van Wincoop
// April 2023
////////////////////////////////////////////////////////////////////////////////

Following the RFS "Code Sharing Policy", we made our best effort so that the codes can be understood by reasonably trained users. 
Hence, the codes include comments. Similarly, we provide details about the software packages, programing languages, data formats, and data sources. 
Beyond that, we stand ready to provide assistance to users of the code.

Concerning the data. We are restricted from sharing the EPFR and DataStream data. 
Hence, we include a pseudo-dataset set to illustrate the format of the files read by the code so that users can better understand the code.

The replication package is composed of:
- the pseudo-data sample
- empty folders (folders "figures", "tables", and in some subfolders of folder "data") to show our folder organization to the reader
- datastream requests to download the variables we use (MSCI, interest rates, exchange rates)
- python codes to clean the downloaded files from datastream
- Stata codes to clean, transform the data and eventually produce the main results
- the Matlab code to produce table 5
- and the MASTER file that runs all Stata do-files sequentially to produce the results.

We believe the MASTER file and the other scripts are well documented. Hence, we do not elaborate on the code here.

We also believe the text and the data appendix in the main article are well documented and allow the replicant to download the data we use.

In the pseudo-data sample, the variables are and correspond to (except when noted otherwise, the storage type of all data is "float" with format %9.0g):
- datem: variable representing months formatted in Stata format --> storage type "int", format %tm 
- fundid: id number of the funds (randomized) --> storage type "long", format %12.0g 
- country: country name in string --> storage type "str10" format %10s 
- id: country id generated from country --> storage type "int", format %24.0g 
- a_region: fund type (Global = global emerging and advanced countries, GEM = global emerging countries) --> storage type "str6", format %9s 
- fundsize: assets under management end of period, in $millions
- ca: country share out of 135 countries, in percent
- zint: country share out of 35 countries, fraction, NOT in percent
- lzint: past country share out of 35 countries, fraction, NOT in percent
- r: monthly equity return (from MSCI), NOT annualized, NOT in percent
- val: valuation effect, monthly
- zbh: buy-and-hold portfolio, fraction
- z_er_24d90: fund expected excess return by econometrician using delta = 0.9 and an horizon of 24 months
- ER24d90: (1-delta)*z_er_24d90
- risk: risk measure
- q1/q8: instruments (see respective labels)
- z_cci: fund consumer confidence index